<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>jquery-upload-file demo</title>
    <link href="http://7xqp2l.com1.z0.glb.clouddn.com/uploadfile.css" rel="stylesheet">
    <script src="http://7xqp2l.com1.z0.glb.clouddn.com/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="http://7xqp2l.com1.z0.glb.clouddn.com/jquery.uploadfile.js"></script>
    <style type="text/css">
        #content {
            width: 600px;
            margin: 0 auto;

        }
        .ajax-file-upload-filename {
            width: 590px;
        }
    </style>
</head>
<body>
<div id="content">
    <div id="fileuploader">Upload</div>
    <button id="extrabutton" class="ajax-file-upload-green">上传</button>
</div>

<script>
    $(document).ready(function () {
        var extraObj = $("#fileuploader").uploadFile({
            url: "uploadFile",
            fileName: "file",
            showFileSize: true,
            showDelete: true,
            autoSubmit: false,
            statusBarWidth: 590,
            dragdropWidth: 590,
            dragdropHeight: 200,
            uploadStr: "选择",
            cancelStr: "取消",
            abortStr: "终止",
            deleteStr: "删除",
            dynamicFormData: function () {
                var data = {"param": ""};
                return data;
            },
            onSuccess: function (files, data, xhr, pd) {
                var obj = eval(data);
                console.log(obj);
            }

        });

        $("#extrabutton").click(function()
        {
            extraObj.startUpload();
        });

    });
</script>
</body>
</html>